package cn.tfyhyc.springcloud.service;

import cn.tfyhyc.springcloud.entities.CommonResult;
import cn.tfyhyc.springcloud.entities.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author 头发又黑又长
 * @Date 2022/10/9 19:57
 * @email zwb15083976291@163.com
 */
@Component
@FeignClient(name = "CLOUD-PAYMENT-SERVICE") // 服务名称
public interface PaymentService {

    @GetMapping("/payment/{id}")
        // 相当于调用 http://CLOUD-PAYMENT-SERVICE/payment/{id}
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);


    // 服务调用超时 测试
    @GetMapping("/payment/feign/timeout")
    public String paymentFeignTimeout();

}
